<template>
  <router-view />
</template>

<script>
import { onMounted } from "vue";
import { getCookie } from "./utils/util.js";

export default {
  setup() {
    onMounted(() => {
      // window.h5sdk.ready(() => { // ready方法不需要每次都调用
      //     tt.requestAuthCode({
      //         appId: 'cli_a26d86808bba900b',
      //         success: (info) => {
      //             console.info(info.code)
      //         },
      //         fail: (error) => {
      //             console.error(error)
      //         }
      //     });
      // });

      let userInfo = getCookie("userInfo");
      if (userInfo) {
        localStorage.setItem("userInfo", userInfo);

        localStorage.setItem("ms_userId", JSON.parse(userInfo).id);
        localStorage.setItem("ms_userNo", JSON.parse(userInfo).employeeId);
        localStorage.setItem("ms_userName", JSON.parse(userInfo).username);
      }
    });
  },
};
</script>

<style>
@import "./assets/css/main.css";
@import "./assets/css/color-dark.css";
</style>
